Skip to content

libxml2 juno patches#1

Open
igormarkoff wants to merge 2 commits intov2.15.1+junofrom
v2.15.1+juno_patches
Open

libxml2 juno patches#1
igormarkoff wants to merge 2 commits intov2.15.1+junofrom
v2.15.1+juno_patches

Conversation

@igormarkoff
Copy link
Copy Markdown
Collaborator

juno patches for the libxml2 library

The four ``vsnprintf(buf, sizeof(buf), msg, ap)`` call sites in
``python/libxml.c`` (pythonWarning, pythonError, pythonFatalError,
libxml_xmlErrorFuncHandler) were updated to allocate ``buf`` /
``str`` on the heap via ``xmlMalloc(1024)`` rather than the stack,
but the ``sizeof(buf)`` argument to ``vsnprintf`` was left in place.
On 64-bit platforms ``sizeof(<pointer>)`` is 8, not 1024, so the
formatted message gets truncated to seven characters before the
trailing NUL.

Pass the allocation size literally (``1024``) to match the
``xmlMalloc`` size and add an explanatory comment at each site.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants